import { TOKEN_TIME, TOKEN_TIME_VALUE } from "./constant";

export const setTokenTime = () => {
  localStorage.setItem(TOKEN_TIME, Date.now());
};

export const getTokenTime = () => {
  return localStorage.getItem(TOKEN_TIME);
};

export const difTokenTime = () => {
  const curTime = Date.now();
  const logTime = getTokenTime();
  return curTime - logTime > TOKEN_TIME_VALUE;
};
